how to mix sync and async code in cypress